﻿using Adnc.Application.Shared.Dtos;
using Adnc.Application.Shared.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WYT.Usr.Application.Contracts.Dtos;
using WYT.Usr.Application.Contracts.Dtos.User;
using WYT.Usr.Application.Contracts.Dtos.Wallet;

namespace WYT.Usr.Application.Contracts.Services
{
    /// <summary>
    /// 用户信息服务
    /// </summary>
    public interface IUserAppService : IAppService
    {
        /// <summary>
        /// 获取用户基本信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<UserBaseInfoDto>> GetUserBaseInfo(long userId);

        /// <summary>
        /// 获取用户授权信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<UserAuthorizeCodeDto>> GetUserAuthorizeCode(long userId);

        /// <summary>
        /// 用户升级检查
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<AppSrvResult<bool>> UserUpgradeCheck(UserUpgradeCheckDto dto);

        /// <summary>
        /// 跟新用户电话号码
        /// </summary>
        /// <param name="input"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        Task<AppSrvResult> UpdateUserPhoneNumber(UserEncryptedInfoDto input, long userID);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult> UpdateUserInfor(long userId, UserEncryptedInfoDto input);

        /// <summary>
        /// 获取用户的交易密码
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<string>> GetWithdrawalPassword(long userId);

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<UserInforDto>> GetUserInfor(long userId);

        /// <summary>
        /// 给用户发送短信验证码
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<bool>> SendUserCode(long userId);

        /// <summary>
        /// 验证用户的验证码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult<bool>> CodeVerify(long userId, string input);

        /// <summary>
        /// 修改用户交易密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="newWord"></param>
        /// <returns></returns>
        Task<AppSrvResult> ChangeWithdrawalPassword(long userId, string newWord);

        /// <summary>
        /// 获取用户等级
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<int>> GetUserGrade(long userId);

        /// <summary>
        /// 获取用户openId
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<string>> GetUserOpenId(long userId);


        /// <summary>
        /// 获取用户头像和名称
        /// </summary>
        /// <param name="userIds"></param>
        /// <returns></returns>
        Task<AppSrvResult<List<UserNameAndHeadDto>>> GetUserNameAndHead(long[] userIds);

        /// <summary>
        /// 用户升级申请
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult<bool>> UserUpgradeApply(long UserId,UserUpgradeApplyDto input);

        /// <summary>
        /// 获取用户团队信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<TeamInfoDto>> GetUserTeamInfor(long userId);

        /// <summary>
        /// 修改电话号码（发送验证码）
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        Task<AppSrvResult> SendChangePhoneCode(long userId,string phone);

        /// <summary>
        /// 修改电话号码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult> ChangePhone(long userId, TelChangeDto input);

        /// <summary>
        /// 添加用户上级
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="Superior"></param>
        /// <returns></returns>
        Task<AppSrvResult> AddSuperior(long userId, long Superior);

        /// <summary>
        /// 团队成员查询
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="teamMemberSearchPagedDto"></param>
        /// <returns></returns>
        Task<AppSrvResult<PageModelDto<TeamMemberInfoDto>>> TeamMemberSearch(long userId, TeamMemberSearchPagedDto teamMemberSearchPagedDto);

        /// <summary>
        /// 根据电话号码查询用户信息
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        Task<AppSrvResult<UserNameAndHeadTelDto>> FindUserByPhone(string phone);
    }
}
